package zestaw4.zadanie1;

/**
 * Author: Daniel
 * Date: 03.08.13
 */

public class Worker {
    private Person person;
    private int salary;

    public Worker(Person person, int salary) {
        this.person = person;
        this.salary = salary;
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Worker)) return false;
        Worker worker = (Worker) obj;
        return salary == worker.salary &&
                person.getName().equals(worker.person.getName());
    }
}
